// Aaron Schraufnagel
// Joel Hunsaker
// TCSS 360 TeamDAMN
// For OnTrack System
// 11/25/14
package teamdamn.model;

import java.util.LinkedList;
import java.util.List;

/**
 * The Response class contains the list of responses including the question, 
 * its associated answers and a flag to determine if it's editable or not.
 * @author joelhun
 * @author Aaron Schraufnagel
 * @date Last Edited: 11/26/14
 */
public class Response {

	/**
	 * The question associated with a specific response.
	 */
	private String myQuestion;
	
	/**
	 * The list of answers associated with the question.
	 */
	private List<ResponseAnswer> myAnswers;
	
	/**
	 * @author joelhun
	 * @param theQuestion
	 */
	public Response(String theQuestion) {
		myQuestion = theQuestion;
		myAnswers = new LinkedList();
	}
	
	/**
	 * @author joelhun
	 * @param theQuestion
	 * @param theAnswers
	 */
	public Response(String theQuestion, List<ResponseAnswer> theAnswers) {
	    myQuestion = theQuestion;
	    myAnswers = theAnswers;
	}
	
	/**
	 * import multiple answers.
	 * @author joelhun
	 * @param theAnswers
	 */
	public void setAnswersList(List<ResponseAnswer> theAnswers) {
	    myAnswers = theAnswers;
	    
	}
	
	/**
	 * add an answer to the answers list.
	 * @author joelhun
	 * @param theAnswer
	 * @param isEditable
	 */
	public void addAnswer(String theAnswer, boolean isEditable) {
		myAnswers.add(new ResponseAnswer(theAnswer, isEditable));
	}
	
	/**
	 * @author joelhun
	 * @return the question.
	 */
	public String getQuestion() {
		return myQuestion;
	}
	
	/**
	 * @author joelhun
	 * @return the answers
	 */
	public List<ResponseAnswer> getAnswers() {
		return myAnswers;
	}
	
}
